6.2.3 - SUI Dividers


A divider is an horizontal line like the ones we can see in the game settings. In SUI it's declared as SLabelDiver. They can optionally have a label on the left and are commonly used to separate sections.


var panel = RegisterNewPanel("panel id", true).Anchor(AnchorType.MiddleCenter).Background(Color.blue, EBackground.RoundedStandard).Size(1280, 720); // creating the blue panel
var container = SContainer.Background(Color.green).Anchor(AnchorType.Fill) // creating the green container
                    - SLabelDivider.Text("Divider"); // adding a divider to the green container

panel.Add(container); // adding the green container to the blue panel
          
Overflowing divider

If you want to remove the text, just write "" in the .Text method:


var panel = RegisterNewPanel("panel id", true).Anchor(AnchorType.MiddleCenter).Background(Color.blue, EBackground.RoundedStandard).Size(1280, 720); // creating the blue panel
var container = SContainer.Background(Color.green).Anchor(AnchorType.Fill) // creating the green container
                    - SLabelDivider.Text(""); // adding a divider with empty text to the green container

panel.Add(container); // adding the green container to the blue panel
            
Overflowing divider without text